# -*- coding: utf-8 -*-
# Powered By: ECHO
# @Time : 2020/12/12 16:56
#反射
import inspect


# class T:
#     def __init__(self):
#         self.a = 0
#         self.b = {}
#
#     def f1(self):
#         print("run f1")
#
#     def f2(self,p1):
#         print("run f2")
#
#     def f3(self,p1,p2):
#         print("run f3")
#
#     def f4(self,p1,p2,p3):
#         print("run f4")
# t = T()

# #获取反射函数的参数列表 inspect模块
# func = getattr(t,"f4")
# res = inspect.getfullargspec(func).__str__() #检查函数 所有的参数
# res = res[res.find("args=[")+5:res.rfind(", varargs")]
# res = eval(res) #执行一个字符串表达式 兵返回表达式的值 ；可以用来字符串转列表
# res.remove("self")
# print(res)
# print(type(res))
# print(len(res))

# params = [["f1"],
#           ["f2","p1","p2"],
#           ["f3","p1","p2"],
#           ["f4","p1","p2","p3"]]
# for p in params:
#     func = getattr(t,p[0])
#     func(*p[1:])

# print(type(eval("3+2")))
# print(type(eval("(1,2,3)")))

# dic = {"a":1,"b":2}
# print(dic.items())
# print(dic.values())
# for key,value in dic.items():
#     print(value)

# import requests
# session = requests.session()
# session.headers["content-type"] = 'application/json; charset=utf-8'
# session.headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
# session.headers["terminalType"] = "android"
#
# # res = session.post("https://m.fcb.com.cn/backapi/banner/appapi/banner/v1/marketingColumn/appList",json={"regionId":440300,"releasePort":16})
#
# rr = session.post("https://broker-sit-api.fcb.com.cn/appapi/broker/uucas/v1/loginUucas",
#                   json={"phone":"15811258830","os_type":"Android","pwd":"6d74b80b22cbed091052fc3350ce225b"})
# print(rr.text)
import json

# from datasrandom.random_idcard_number import IDCARD
# from datasrandom.random_phone_number import phoneNumber
#
#
# def recommend(self,intentionBuildingId,prodGUID,provinceId):
#         """
#         房车宝经纪人app的推荐接口
#         :param intentionBuildingId:产品id
#         :param prodGUID: 产品guid
#         :param provinceId: 产品所属省份
#         :return:
#         """
#         idcard = IDCARD()
#         certNo = idcard.idcard() #随机身份证后6位
#         phone = phoneNumber()
#         mobileNo = phone.phoneNumber() #随机电话号码
#         params = {
# 	    "arriveBuildingId":"",
# 	    "arriveBuildingName":"",
# 	    "arriveProvinceName":"",
# 	    "certNo":certNo,
# 	    "cstName":"恒大电脑IT",
# 	    "hasHalls":False,
# 	    "intentionBuildingId":intentionBuildingId,
# 	    "isJointMarketing":False,
# 	    "isRecommend":False,
# 	    "isRequiredByPerson":False,
# 	    "mobileNo":mobileNo,
# 	    "needDetail":{
# 		        "area":{
# 			        "1":"60-80m²"
# 		    },
# 		"focus":{
# 			"1":"学区",
# 			"7":"物业服务"
# 		},
# 		"product":{
# 			"1":"洋房"
# 		},
# 		"roomType":{
# 			"4":"五室及以上",
# 			"1":"二室"
# 		}
# 	},
# 	"planDate":"2022-12-31",
# 	"prodGUID":prodGUID,
# 	"provinceId":provinceId,
# 	"remark":"uG8次超好吃哦v叫哦惧怕",
# 	"source":0
# }
#         self.post("/appapi/broker/recommend/v1/recommendCustomer",params)
#         return
import requests

session = requests.session()

url = "https://broker-sit-api.fcb.com.cn"
def fcb_get(path, params=""):
	"""
    房车宝一些get接口是返回网页并且断言
    :param path:
    :param params:
    :return:
    """
	if params is None or params == "":
		params = None
	if path is None or path == "":
		print("False" + "接口错误，接口地址不能为空")

	if not path.startswith("http"):
		path = url + "/" + path

	try:
		if params is not None:
			result = session.get(path + "?" + params)
		else:
			result = session.get(path)

		print("true" + result.text)
	except Exception as e:
		print("false" +  str(e))
		return False
	return True